//
//  KLHouseModel.m
//  KLShoppingList
//
//  Created by apple on 2017/8/16.
//  Copyright © 2017年 NetEaseExam. All rights reserved.
//

#import "KLHouseModel.h"

#import "KLGoodModel.h"

@implementation KLHouseModel

- (instancetype)initWithDict:(NSDictionary *)dict{
    if (self = [super init]) {
        [self setValuesForKeysWithDictionary:dict];
        //把self.friends由字典数组转换为模型
        NSMutableArray *modelArray = [NSMutableArray array];
        for (NSDictionary *dict in self.goods) {
            KLGoodModel *model = [KLGoodModel goodWithDict:dict];
            [modelArray addObject:model];
        }
        self.goods = [modelArray mutableCopy];
    }return self;
}

+ (instancetype)houseWithDict:(NSDictionary *)dict{
    return [[self alloc] initWithDict:dict];
}

@end
